home *** CD-ROM | disk | FTP | other *** search
/ Champak 132 (Alt) / Vol 132.iso / games / tremclad.swf / scripts / frame_4 / DoAction.as
Encoding:
Text File  |  2011-06-09  |  1.1 KB  |  48 lines

  1. function moveToy(a)
  2. {
  3.    a.mod != 0 ? a.fal++ : (a._x += spd);
  4.    a.mod != 1 ? (a.fal = -20) : (a._rotation += 11, a._y += a.fal, a._x += spd);
  5.    if(a._x > 650)
  6.    {
  7.       a.gd != 0 ? life-- : null;
  8.       a.removeMovieClip();
  9.    }
  10.    a._y <= 400 ? null : a.removeMovieClip();
  11.    a.onPress = function()
  12.    {
  13.       a.swapDepths(a.getDepth() + 100);
  14.       a.mod = 1;
  15.       a.gd != 0 ? (score += 5) : (score -= 10);
  16.    };
  17. }
  18. mac.swapDepths(1000);
  19. toy = 0;
  20. spd = 5;
  21. score = 0;
  22. tim = 0;
  23. life = 5;
  24. max = 0;
  25. grants = 0;
  26. onEnterFrame = function()
  27. {
  28.    score <= max ? null : (max = score);
  29.    Math.floor(max / 200) <= grants ? null : (grants++, life++);
  30.    spd = score / 100 + 5;
  31.    tim--;
  32.    if(tim < 1)
  33.    {
  34.       if(random(2) == 0)
  35.       {
  36.          goo.duplicateMovieClip("gg" + toy,100 + toy,{_x:ar._x,_y:ar._y,mod:0,gd:0});
  37.       }
  38.       else
  39.       {
  40.          bad.duplicateMovieClip("bb" + toy,100 + toy,{_x:ar._x,_y:ar._y,mod:0,gd:1});
  41.       }
  42.       toy >= 100 ? (toy = 0) : toy++;
  43.       tim = Math.floor(100 / spd);
  44.    }
  45.    score >= 0 ? null : (score = 0);
  46.    life >= 1 ? null : (nextFrame(), ┬º┬ºpush(undefined), undefined);
  47. };
  48.